package com.hoopchina.ui.download;
import android.view.View;

import com.hoopchina.meta.DataItemBase;

class DownloadItem extends DataItemBase {
    private String mType;
    private int    mProgress = 0;
    private int    mTotalNum = 0;
    private int    mDoneNum  = 0;
    private int    mVisibility;

    public DownloadItem( int aDone, int aTotal, String aType ) {
        mType = "";
        setTotalNum( aTotal );
        setDoneNum( aDone );
        setType( aType );
        mVisibility = View.GONE;
    }

    public void setProgress( int mProgress ) {
        this.mProgress = mProgress;
    }

    public int getProgress() {
        return mProgress;
    }

    public void setType( String mType ) {
        this.mType = mType;
    }

    public String getType() {
        return mType;
    }

    public void setTotalNum( int mTotalNum ) {
        this.mTotalNum = mTotalNum;
    }

    public int getTotalNum() {
        return mTotalNum;
    }

    public void setDoneNum( int mDoneNum ) {
        this.mDoneNum = mDoneNum;
        setProgress( this.getTotalNum() == 0 ? 0 : mDoneNum * 100 / this.getTotalNum() );
    }

    public int getDoneNum() {
        return mDoneNum;
    }

    public void setVisibility( int aVisibility ) {
        this.mVisibility = aVisibility;
    }

    public int getVisibility() {
        return mVisibility;
    }

}